# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=bluepot
pkgver=0.2
pkgrel=1
groups=('blackarch' 'blackarch-bluetooth' 'blackarch-honeypot')
pkgdesc='A Bluetooth Honeypot written in Java, it runs on Linux.'
arch=('any')
url='https://github.com/andrewmichaelsmith/bluepot'
license=('GPL3')
depends=('java-environment' 'gksu')
source=("https://github.com/andrewmichaelsmith/$pkgname/raw/master/bin/$pkgname-$pkgver.tar.gz")
sha512sums=('cd4c5fc42cfbb27263b99ad50905844f4e550d03c47578f7435a669651ebaed5b954c7f7fd55db9495842e8adb3e6fe888a166dcb10c4ab94f33269dd02ac746')

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"

  install -Dm 644 "$pkgname.jar" "$pkgdir/usr/share/$pkgname/$pkgname.jar"
  #install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname/
exec java -jar $pkgname.jar "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

